/*
 * @Author: C.
 * @Date: 2023-12-12 16:44:37
 */
import Input from '@tuniao/tnui-vue3-uniapp/components/input/src/input.vue'
import Switch from '@tuniao/tnui-vue3-uniapp/components/switch/src/switch.vue'
import InputNumber from '@tuniao/tnui-vue3-uniapp/components/number-box/src/number-box.vue'
import Slider from '@tuniao/tnui-vue3-uniapp/components/slider/src/slider.vue'
import WeekPicker from '@tuniao/tnui-vue3-uniapp/components/week-calendar/src/week-calendar.vue'
import CheckBox from './components/check-box.vue'
import Radio from './components/radio.vue'
import Select from './components/select.vue'
import DatePicker from './components/date-picker.vue'
import TimePicker from './components/time-picker.vue'
import RegionPicker from './components/region-picker.vue'
import Upload from './components/upload.vue'
// import TnInput from '@tuniao/tnui-vue3-uniapp/components/input/src/input.vue'
import type { Component } from 'vue'
export type ComponentType =
  | 'Input'
  | 'Switch'
  | 'InputNumber'
  | 'CheckBox'
  | 'Radio'
  | 'Select'
  | 'Slider'
  | 'DatePicker'
  | 'TimePicker'
  | 'RegionPicker'
  | 'WeekPicker'
  | 'Upload'
const componentMap = new Map<ComponentType, Component>()
componentMap.set('Input', Input)
componentMap.set('Switch', Switch)
componentMap.set('InputNumber', InputNumber)
componentMap.set('CheckBox', CheckBox)
componentMap.set('Radio', Radio)
componentMap.set('Select', Select)
componentMap.set('Slider', Slider)
componentMap.set('DatePicker', DatePicker)
componentMap.set('TimePicker', TimePicker)
componentMap.set('RegionPicker', RegionPicker)
componentMap.set('WeekPicker', WeekPicker)
componentMap.set('Upload', Upload)

export function add(compName: ComponentType, component: Component) {
  componentMap.set(compName, component)
}

export function del(compName: ComponentType) {
  componentMap.delete(compName)
}
export { componentMap }
